home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 12
/
Mac Magazin and MacEasy Magazine CD - Issue 12.iso
/
CD Extras
/
Plug-ins
/
SODAColor
/
SODA-PlugIns-1
/
Plug-In-Collection-1
/
Transparent Link
< prev
next >
Wrap
Text File
|
1994-11-07
|
5KB
|
152 lines
--SODABuildPlug
--Transparent Link
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
SODAColor™
Transparent Link :
This plug-in allows you to create transparent buttons in SODAColor which link to other cards.
LOADING THIS SCRIPT INTO SODACOLOR:
1. Select "Load New Plug-In" from the plug-in list (TV-icon on edit palette).
2. Select this document.
USING THIS PLUG-IN:
1. Select a card you would like to link to from the list.
2. Drag a rectangle over the area of the screen you want this button to cover
3. Tell SODAColor whether or not you want this button hilited when clicked.
NOTE: This button links you to another card by number not by name. If you re-order your cards later on, this button may link to a different card.
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
on mouseUp
global CardNameList
createCardNameList
put "This plug-in allows you to create a link to another card by clicking over a transparent button on the screen." into myprompt
put "Do you want to create a link?" into prompt2
answer myPrompt&return&return&prompt2 with "Cancel" or "Build it!"
if it is "Cancel" then exit mouseUp
put the number of this card into Mike
put grabCards()into myCards
delete line 1 of myCards
put "Which card do you want to link to?" into myPrompt
put "LINK" into myButton
put getList(myPrompt,myCards,mybutton) into wally
if wally is empty then exit mouseUp
put wally+1 into wally
answer"Now please drag a rectangle over the area you want your button to cover"
put sodaRect() into myRect
lock screen
choose tool 2
put the number of cd btns into myBNum
domenu "New Button"
put myBNum+1 into myBNum
put "Linker"&&MyBnum into myBName
if there is not a cd btn myBNum then
answer "Problem encountered. Please make sure you're on the card layer"
exit mouseUp
end if
set the name of cd btn myBNum to myBName
set the rect of cd btn myBName to myRect
set the showname of cd btn myBName to false
set the style of cd btn myBName to transparent
set the autohilite of cd btn myBname to true
--Autohilite?
answer "Do you want this button to invert when pressed?" with "No" or "Yes"
if it is "No" then set the autohilite of cd btn myBName to false
--Link Script:
put "Go cd"&&wally&return into myScript
put "Set the hilite of me to false" after myScript
put the script of bg btn "SODAPlugButt" into nuScript
put myScript into line 20 of nuScript
--Flashing rect whilst repositioning:
put " repeat until the mouseClick"&return into Repos
put "set the hilite of me to true"&return after Repos
put "set the hilite of me to false"&return after Repos
put Repos into line 5 of nuScript
--Now Insert the Script:
set the script of cd btn myBName to nuScript
--Inform user:
answer "•Option-Click on this button to re-position it."&return&¬
"•Command-Click to delete it"&return&"•Single-Click to run its script."
choose tool 1
end mouseUp
function grabCards
repeat with curCard = 1 to number of cards
get the short name of card curCard
put curcard&". "&it&return after myCards
end repeat
return myCards
end grabCards
on doSort newPosition
global SortCount
lock screen
put zero into SortCount
put number of cards in this stack into numCards
put createSortList(numCards,newPosition) into sortList
go first card
-- use 'number of this card' because cards are not stored on disk sequentially
sort ascending numeric by item (number of this card) of sortList
go card newPosition
unlock screen
end doSort
function createSortList numCards,newPosition
put empty into cardList
repeat with count = 1 to numCards
put count & "," after cardList
end repeat
delete last char of cardList
put number of this card into currentPosition
if newPosition <= currentPosition then
put 1 into adjust
put newPosition into start
else
put -1 into adjust
put currentPosition + 1 into start
end if
put start + abs(currentPosition - newPosition) - 1 into finish
put newPosition into item currentPosition of cardList
repeat with i = start to finish
add adjust to item i of cardList
end repeat
return cardList
end createSortList
function GetList myPrompt,myList,myButton
put 1 into myLine
repeat forever
get showList(myList,myPrompt,false,true,¬
myButton&",Cancel",myLine)
put it into choice
put line 2 of choice into myLine
if line 1 of choice="Cancel" then
return empty
exit GetList
else if line 2 of choice is empty then
return empty
exit GetList
else
return myLine
exit GetList
end if
end repeat
end GetList